package cn.wolfcode.crm.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Setter
@Getter
public class Employee extends BaseDomain{

    private static final long serialVersionUID = 1L;

	private String username;

    private String realname;

    private String password;

    private String tel;

    private String email;

    private Department dept;
    
    //封装格式
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    //输出格式
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date hiredate;
    
    //状态有多种,无法用boolean表示
    private int state;

    private boolean admin;
    //关联角色 : 多对多 员工为主体
    private List<Role> roles = new ArrayList<>();

}